import Vue from "vue";
/*import { sync } from 'vuex-router-sync'*/
import vueRouter from "vue-router";
//全局事件
import bus from "vue-bus";
import ElementUI from "element-ui";
//import 'element-ui/lib/theme-default/index.css';
import "element-ui/lib/theme-chalk/index.css";
import routeConfig from "./routes";
import request from "./ajax.js";
import App from "../App";
//兼容ie
import "babel-polyfill";
require("./module.js");

const router = new vueRouter({
	routes: routeConfig
});

router.beforeEach((to, from, next) => {
	//跳转之前
	next();
});

router.afterEach(() => {
	//跳转之后
	window.scrollTo(0, 0);
});

Vue.use(bus);
Vue.use(ElementUI);
Vue.use(vueRouter);

/*sync(store, router)*/
new Vue({
	router,
	render: h => h(App),
	el: "#app"
});
